<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>无人机巡检</title>
</head>
<style>
  html, body, video {
    margin: 0;
    padding: 0;
    border: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
  }
</style>
<body>
<video autoplay muted loop="loop">
  <source id="videoPlay" src="" type="video/mp4">
</video>
<script>
  var videoElement = document.getElementById('videoPlay')
  var name = getQueryVariable('name')
  videoElement.src = name + '.mp4'

  //videoElement.play();

  function getQueryVariable(variable) {
    var query = window.location.search.substring(1)
    var vars = query.split('&')
    for (var i = 0; i < vars.length; i++) {
      var pair = vars[i].split('=')
      if (pair[0] === variable) {
        return pair[1]
      }
    }
    return ''
  }

  // 暂停播放
  function pause() {
    videoElement.pause()
  }

  // 播放
  function play() {
    videoElement.play()
  }

</script>

</body>
</html>
